#coding=utf-8

from uliweb.orm import *
from uliweb.utils.common import get_var
import datetime

class Audit(Model):
    __dispatch_enabled__ = False
    
    table_id = Reference('tables', verbose_name="操作表", required=True)
    title = Field(str, max_length=255, verbose_name='标题')
    parent_id = Field(int, verbose_name="父ID")
    obj_id = Field(int, verbose_name="ID", required=True)
    changed_value = Field(BLOB, verbose_name="修改内容")
    old_value = Field(BLOB, verbose_name="原内容")
    modify_flag = Field(CHAR, max_length=1, verbose_name="修改标志", choices=get_var('PARA/AUDIT_MODIFY_FLAG'))
    modified_date = Field(datetime.datetime, verbose_name='修改时间')
    modified_user = Reference('user', verbose_name='修改人', collection_name='modifier_audits')
    
